home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / bankp.c < prev    next >
C/C++ Source or Header  |  2000-04-04  |  8KB  |  261 lines

  1. /***************************************************************************
  2.  
  3. Bank Panic memory map (preliminary)
  4. Similar to Appoooh
  5.  
  6. driver by Nicola Salmoria
  7.  
  8.  
  9. 0000-dfff ROM
  10. e000-e7ff RAM
  11. f000-f3ff Video RAM #1
  12. f400-f7ff Color RAM #1
  13. f800-fbff Video RAM #2
  14. fc00-ffff Color RAM #2
  15.  
  16. I/O
  17. read:
  18. 00  IN0
  19. 01  IN1
  20. 02  IN2
  21. 04  DSW
  22.  
  23. write:
  24. 00  SN76496 #1
  25. 01  SN76496 #2
  26. 02  SN76496 #3
  27. 05  horizontal scroll
  28. 07  bit 0-1 = at least one of these two controls the playfield priority
  29.     bit 2-3 = ?
  30.     bit 4 = NMI enable
  31.     bit 5 = flip screen
  32.     bit 6-7 = ?
  33.  
  34. ***************************************************************************/
  35.  
  36. #include "driver.h"
  37. #include "vidhrdw/generic.h"
  38.  
  39.  
  40. extern unsigned char *bankp_videoram2;
  41. extern unsigned char *bankp_colorram2;
  42. void bankp_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  43. WRITE_HANDLER( bankp_videoram2_w );
  44. WRITE_HANDLER( bankp_colorram2_w );
  45. WRITE_HANDLER( bankp_scroll_w );
  46. WRITE_HANDLER( bankp_out_w );
  47. int bankp_vh_start(void);
  48. void bankp_vh_stop(void);
  49. void bankp_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  50.  
  51.  
  52.  
  53. static struct MemoryReadAddress readmem[] =
  54. {
  55.     { 0x0000, 0xdfff, MRA_ROM },
  56.     { 0xe000, 0xe7ff, MRA_RAM },
  57.     { 0xf000, 0xffff, MRA_RAM },
  58.     { -1 }    /* end of table */
  59. };
  60.  
  61. static struct MemoryWriteAddress writemem[] =
  62. {
  63.     { 0x0000, 0xdfff, MWA_ROM },
  64.     { 0xe000, 0xe7ff, MWA_RAM },
  65.     { 0xf000, 0xf3ff, videoram_w, &videoram, &videoram_size },
  66.     { 0xf400, 0xf7ff, colorram_w, &colorram },
  67.     { 0xf800, 0xfbff, bankp_videoram2_w, &bankp_videoram2 },
  68.     { 0xfc00, 0xffff, bankp_colorram2_w, &bankp_colorram2 },
  69.     { -1 }    /* end of table */
  70. };
  71.  
  72.  
  73. static struct IOReadPort readport[] =
  74. {
  75.     { 0x00, 0x00, input_port_0_r },    /* IN0 */
  76.     { 0x01, 0x01, input_port_1_r },    /* IN1 */
  77.     { 0x02, 0x02, input_port_2_r },    /* IN2 */
  78.     { 0x04, 0x04, input_port_3_r },    /* DSW */
  79.     { -1 }    /* end of table */
  80. };
  81.  
  82. static struct IOWritePort writeport[] =
  83. {
  84.     { 0x00, 0x00, SN76496_0_w },
  85.     { 0x01, 0x01, SN76496_1_w },
  86.     { 0x02, 0x02, SN76496_2_w },
  87.     { 0x05, 0x05, bankp_scroll_w },
  88.     { 0x07, 0x07, bankp_out_w },
  89.     { -1 }    /* end of table */
  90. };
  91.  
  92.  
  93.  
  94. INPUT_PORTS_START( bankp )
  95.     PORT_START    /* IN0 */
  96.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* probably unused */
  97.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY )
  98.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* probably unused */
  99.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT | IPF_2WAY )
  100.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  101.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
  102.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 )
  103.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 )
  104.  
  105.     PORT_START    /* IN1 */
  106.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* probably unused */
  107.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_COCKTAIL )
  108.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* probably unused */
  109.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT | IPF_2WAY | IPF_COCKTAIL )
  110.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL )
  111.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 )
  112.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )
  113.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_COCKTAIL )
  114.  
  115.     PORT_START    /* IN2 */
  116.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3 )
  117.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 | IPF_COCKTAIL )
  118.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 )
  119.     PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* probably unused */
  120.  
  121.     PORT_START    /* DSW */
  122.     PORT_DIPNAME( 0x03, 0x00, "Coin A/B" )
  123.     PORT_DIPSETTING(    0x03, DEF_STR( 3C_1C ) )
  124.     PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
  125.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  126.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
  127.     PORT_DIPNAME( 0x04, 0x00, "Coin C" )
  128.     PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
  129.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  130.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Lives ) )
  131.     PORT_DIPSETTING(    0x00, "3" )
  132.     PORT_DIPSETTING(    0x08, "4" )
  133.     PORT_DIPNAME( 0x10, 0x00, DEF_STR( Bonus_Life ) )
  134.     PORT_DIPSETTING(    0x00, "70K 200K 500K ..." )
  135.     PORT_DIPSETTING(    0x10, "100K 400K 800K ..." )
  136.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Difficulty ) )
  137.     PORT_DIPSETTING(    0x00, "Easy" )
  138.     PORT_DIPSETTING(    0x20, "Hard" )
  139.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) )
  140.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  141.     PORT_DIPSETTING(    0x40, DEF_STR( On ) )
  142.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) )
  143.     PORT_DIPSETTING(    0x80, DEF_STR( Upright ) )
  144.     PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
  145. INPUT_PORTS_END
  146.  
  147.  
  148.  
  149. static struct GfxLayout charlayout =
  150. {
  151.     8,8,    /* 8*8 characters */
  152.     1024,    /* 1024 characters */
  153.     2,    /* 2 bits per pixel */
  154.     { 0, 4 },    /* the bitplanes are packed in one byte */
  155.     { 8*8+3, 8*8+2, 8*8+1, 8*8+0, 3, 2, 1, 0 },
  156.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  157.     16*8    /* every char takes 8 consecutive bytes */
  158. };
  159. static struct GfxLayout charlayout2 =
  160. {
  161.     8,8,    /* 8*8 characters */
  162.     2048,    /* 2048 characters */
  163.     3,    /* 3 bits per pixel */
  164.     { 0, 2048*8*8, 2*2048*8*8 },    /* the bitplanes are separated */
  165.     { 7, 6, 5, 4, 3, 2, 1, 0 },
  166.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  167.     8*8    /* every char takes 8 consecutive bytes */
  168. };
  169.  
  170. static struct GfxDecodeInfo gfxdecodeinfo[] =
  171. {
  172.     { REGION_GFX1, 0, &charlayout,      0, 32 },
  173.     { REGION_GFX2, 0, &charlayout2,  32*4, 16 },
  174.     { -1 } /* end of array */
  175. };
  176.  
  177.  
  178.  
  179. static struct SN76496interface sn76496_interface =
  180. {
  181.     3,    /* 3 chips */
  182.     { 3867120, 3867120, 3867120 },    /* ?? the main oscillator is 15.46848 Mhz */
  183.     { 100, 100, 100 }
  184. };
  185.  
  186.  
  187.  
  188. static struct MachineDriver machine_driver_bankp =
  189. {
  190.     /* basic machine hardware */
  191.     {
  192.         {
  193.             CPU_Z80,
  194.             3867120,    /* ?? the main oscillator is 15.46848 Mhz */
  195.             readmem,writemem,readport,writeport,
  196.             nmi_interrupt,1
  197.         },
  198.     },
  199.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  200.     1,    /* single CPU, no need for interleaving */
  201.     0,
  202.  
  203.     /* video hardware */
  204.     32*8, 32*8, { 3*8, 31*8-1, 2*8, 30*8-1 },
  205.     gfxdecodeinfo,
  206.     32, 32*4+16*8,
  207.     bankp_vh_convert_color_prom,
  208.  
  209.     VIDEO_TYPE_RASTER,
  210.     0,
  211.     bankp_vh_start,
  212.     bankp_vh_stop,
  213.     bankp_vh_screenrefresh,
  214.  
  215.     /* sound hardware */
  216.     0,0,0,0,
  217.     {
  218.         {
  219.             SOUND_SN76496,
  220.             &sn76496_interface
  221.         }
  222.     }
  223. };
  224.  
  225.  
  226.  
  227. /***************************************************************************
  228.  
  229.   Game driver(s)
  230.  
  231. ***************************************************************************/
  232.  
  233. ROM_START( bankp )
  234.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  235.     ROM_LOAD( "epr6175.bin",  0x0000, 0x4000, 0x044552b8 )
  236.     ROM_LOAD( "epr6174.bin",  0x4000, 0x4000, 0xd29b1598 )
  237.     ROM_LOAD( "epr6173.bin",  0x8000, 0x4000, 0xb8405d38 )
  238.     ROM_LOAD( "epr6176.bin",  0xc000, 0x2000, 0xc98ac200 )
  239.  
  240.     ROM_REGION( 0x04000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  241.     ROM_LOAD( "epr6165.bin",  0x0000, 0x2000, 0xaef34a93 )    /* playfield #1 chars */
  242.     ROM_LOAD( "epr6166.bin",  0x2000, 0x2000, 0xca13cb11 )
  243.  
  244.     ROM_REGION( 0x0c000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  245.     ROM_LOAD( "epr6172.bin",  0x0000, 0x2000, 0xc4c4878b )    /* playfield #2 chars */
  246.     ROM_LOAD( "epr6171.bin",  0x2000, 0x2000, 0xa18165a1 )
  247.     ROM_LOAD( "epr6170.bin",  0x4000, 0x2000, 0xb58aa8fa )
  248.     ROM_LOAD( "epr6169.bin",  0x6000, 0x2000, 0x1aa37fce )
  249.     ROM_LOAD( "epr6168.bin",  0x8000, 0x2000, 0x05f3a867 )
  250.     ROM_LOAD( "epr6167.bin",  0xa000, 0x2000, 0x3fa337e1 )
  251.  
  252.     ROM_REGION( 0x0220, REGION_PROMS )
  253.     ROM_LOAD( "pr6177.clr",   0x0000, 0x020, 0xeb70c5ae )     /* palette */
  254.     ROM_LOAD( "pr6178.clr",   0x0020, 0x100, 0x0acca001 )     /* charset #1 lookup table */
  255.     ROM_LOAD( "pr6179.clr",   0x0120, 0x100, 0xe53bafdb )     /* charset #2 lookup table */
  256. ROM_END
  257.  
  258.  
  259.  
  260. GAME( 1984, bankp, 0, bankp, bankp, 0, ROT0, "Sega", "Bank Panic" )
  261.